<?php namespace Hdphp\Cookie;

class Cookie
{
    public function __construct(){}

    public function get($name)
    {
    	if(isset($_COOKIE[$name]))
    	{
    		return $_COOKIE[$name];
    	}
    }

    public function all()
    {
    	return $_SESSION;
    }

    public function set($name,$value,$expire=0,$path='/',$domain=null)
    {
    	setcookie($name,$value,$expire,$path,$domain);
    }

    public function del($name)
    {
    	return setcookie($name,$value,1);
    }

    public function has($name)
    {
    	return isset($_COOKIE[$name]);
    }

    public function flush()
    {
    	foreach($_COOKIE as $key=>$value)
        {
            setcookie($name,$value,1);
        }
    	
    }
}